import request from '@/utils/request'


/**
 * 场馆列表
 * @returns {*}
 */
export function getVenueList(params) {
  return request({
    url: '/systemj/venue/list',
    method: 'get',
    params: params
  })
}

/**
 * 编辑场馆
 * @param data
 * @returns {*}
 */
export function modifyVenue(data) {
  return request({
    url: '/systemj/venue',
    method: data.id ? 'put' : 'post',
    data: data
  })
}

/**
 * 删除场馆
 * @param id
 * @returns {*}
 */
export function delVenue(id) {
  return request({
    url: `/systemj/venue/${id}`,
    method: 'delete'
  })
}

/**
 * 冻结解冻
 * @param venue
 * @returns {*}
 */
export function changeVenueStatus(venue) {
  return request({
    url: `/systemj/venue/${venue.status == 0 ? 'disable' : 'enable'}/${venue.id}`,
    method: 'post'
  })
}
